chrome.storage.local.get('keywords', function(result) {	
	var s = result.keywords;
	var sl = s.split(';');
	var a = document.getElementsByTagName('a');
	for (var i=0; i<a.length; i++) {
		for (var j=0; j<sl.length; j++) {
			if (a[i].textContent.indexOf(sl[j]) != -1) {
				a[i].style.color = 'white';
				a[i].style.backgroundColor = '#DA3434';
				//console.log(a[i].style.cssText);
			}
		}
	}
});

chrome.storage.local.get('keywords_hide', function(result) {	
	var s = result.keywords_hide;
	var sl = s.split(';');
	var a = document.getElementsByTagName('a');
	for (var i=0; i<a.length; i++) {
		for (var j=0; j<sl.length; j++) {
			if (a[i].textContent.indexOf(sl[j]) != -1) {
				a[i].style.display = 'none';
			}
		}
	}
});

var li = document.getElementsByTagName('li');
var yg = 0, vip = 0;
for (var i = 0; i < li.length; i++) {
	if (li[i].innerHTML.indexOf('预告') != -1) {
		li[i].style.display = 'none';
		yg++;
	}
	if (li[i].innerHTML.indexOf('VIP免费') != -1) {
		li[i].style.display = 'none';
		vip++;
	}
}
//console.log("隐藏 [预告] " + yg + " 个");
//console.log("隐藏 [VIP免费] " + vip + " 个");
